<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //通过循环按行顺序为一个5×5的二维数组a赋1到25的自然数，然后输出该数组。试编程。
        var arr = [];
        var num = 0;
        for (var a = 0; a < 5; a++) {
            var one = [];
            for (var i = 0; i < 5; i++) {
                num++;
                one.push(num);
            }
            arr.push(one);
        }
        console.log(arr);
    </script>
</body>

</html>